// 本文件定义打印日志的函数

package core

import (
    "fmt"

    "common"
)


// 打印资产
func PrintProperty(country1 common.Country, company1 common.Company,
person1 common.Person, person2 common.Person)  {
    // 打印国家资本和主板数
    fmt.Printf("country_Money = %.2f\n", country1.Money)
    fmt.Printf("country_MaterialNum = %d\n", country1.MaterialNum)
    // 打印企业资本和商品数
    fmt.Printf("company_Money = %.2f\n", company1.Money)
    fmt.Printf("company_MaterialNum = %d\n", company1.MaterialNum)
    fmt.Printf("company_PcNum = %d\n", company1.PcNum)
    // 打印公民1资本和财产数
    fmt.Printf("person1_Money = %.2f\n", person1.Money)
    fmt.Printf("person1_PcNum = %d\n", person1.PcNum)
    // 打印公民2资本和财产数
    fmt.Printf("person2_Money = %.2f\n", person2.Money)
    fmt.Printf("person2_PcNum = %d\n", person2.PcNum)
}

// 打印账本
func PrintBook()  {
    for i, record := range common.Book1 {
        fmt.Printf("index: %d: Buyer = %s, Seller = %s, " +
            "Content = %s, Num = %d, 售价 = %.2f\n",
            i + 1, record.Buyer, record.Seller, record.Content,
            record.Num, record.Amount)
    }
}
